/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Test;

import Model.Beans.Institution;
import Model.Beans.User;
import Model.DAO.InstitutionDAO;
import Model.DAO.UserDAO;
import java.util.List;

/**
 *
 * @author sixviv
 */
public class Main {
    public static void main(String...args) {
        InstitutionDAO idao = new InstitutionDAO();
        User u = new User();
        u.setPassword("123");
        u.setType("I");
        u.setUsername("uady");
        UserDAO udao = new UserDAO();
        udao.insertar(u);
        Institution i = new Institution();
        i.setAddress("address");
        i.setName("name");
        i.setPhone("phone");
        i.setUser(u);
        idao.insertar(i);
        List<Institution> list = idao.getAll(Institution.class);
        for(Institution ins : list)
            System.out.println(ins.getName());
        System.out.println("Done!");
    }
}
